import re
if __name__ == '__main__':
    text = 'abbaaabbbbaaaaa'

    pattern = 'ab'

    # 返回所有匹配的字符串列表
    for match in re.findall(pattern=pattern, string=text):
        print('Found {!r}'.format(match))
